import base from '@/api/baseurl';
import request from '@/utils/request'

export function fetchListTerm(query) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/findTerm',
    method: 'get',
    params: query
  })
}

//单行删除
export function deleteTerm(query) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/delTerm',
    method: 'get',
    params: query
  })
}



export function addTerm(data) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/addTerm',
    method: 'post',
    data
  })
}

export function updateTerm(data) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/updateTerm',
    method: 'post',
    data
  })
}

export function TermCom(query) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/queryTermCom',
    method: 'get',
    params: query
  })
}

export function addTermDate(data) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/addTermDate',
    method: 'post',
    data
  })
}

export function updateTermDate(data) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/updateTermDate',
    method: 'post',
    data
  })
}



/**
 * 查询相关id所有期限数据-适配新增功能
 * @param {*} query 
 * @returns 
 */
export function findTermcodename(query) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/findTermcodename',
    method: 'get',
    params: query
  })
}


/**
 * 查询相关id所有期限数据-适配修改功能
 * @param {*} query 
 * @returns 
 */
 export function updatefindTermcodename(query) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/updatefindTermcodename',
    method: 'get',
    params: query
  })
}


/**
 * 
 * @param {*} query  m_id
 * @returns 
 */
export function addterm_code(query) {
  return request({
    baseURL:base.appBaseApi,
    url: '/CurveTerm/addterm_code',
    method: 'get',
    params: query
  })
}

 
